import axios from 'axios';
import {Toast} from 'antd-mobile'
// 创建axios实例
const Axios = axios.create({
  baseURL: 'https://www.linweiqin.cn/api/public/v1/',
})
// 请求拦截
Axios.interceptors.request.use(config => {
  // Do something before request is sent
  Toast.loading('加载中...', 0, () => {
    console.log('Load complete !!!');
  });
  return config;
}, error => {
  // Do something with request error
  return Promise.reject(error);
});
// 响应拦截
Axios.interceptors.response.use(response => {
  // Do something before response is sent
  Toast.hide();
  return response.data.message;
}, error => {
  // Do something with response error
  return Promise.reject(error);
});
export default Axios